package org.jsola.hr.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.jsola.core.dto.BaseDTO;

import javax.validation.constraints.NotNull;

import static org.jsola.core.example.BaseExample.E_LEVEL;
import static org.jsola.core.example.BaseExample.E_PARENT_ID;
import static org.jsola.core.example.BaseExample.E_SORT;
import static org.jsola.core.example.BaseExample.N_LEVEL;
import static org.jsola.core.example.BaseExample.N_PARENT_ID;
import static org.jsola.core.example.BaseExample.N_SORT;
import static org.jsola.hr.example.PositionInfoExample.E_CODE;
import static org.jsola.hr.example.PositionInfoExample.E_COMPANY_ID;
import static org.jsola.hr.example.PositionInfoExample.E_DESC;
import static org.jsola.hr.example.PositionInfoExample.E_FORMAL_NUM;
import static org.jsola.hr.example.PositionInfoExample.E_NAME;
import static org.jsola.hr.example.PositionInfoExample.E_REMARK;
import static org.jsola.hr.example.PositionInfoExample.E_TYPE;
import static org.jsola.hr.example.PositionInfoExample.M_CODE_MAX;
import static org.jsola.hr.example.PositionInfoExample.M_COMPANY_ID_MAX;
import static org.jsola.hr.example.PositionInfoExample.M_COMPANY_ID_NOT_NULL;
import static org.jsola.hr.example.PositionInfoExample.M_DESC_MAX;
import static org.jsola.hr.example.PositionInfoExample.M_LEVEL_NOT_NULL;
import static org.jsola.hr.example.PositionInfoExample.M_NAME_MAX;
import static org.jsola.hr.example.PositionInfoExample.M_NAME_NOT_NULL;
import static org.jsola.hr.example.PositionInfoExample.M_PARENT_ID_MAX;
import static org.jsola.hr.example.PositionInfoExample.M_PARENT_ID_NOT_NULL;
import static org.jsola.hr.example.PositionInfoExample.M_REMARK_MAX;
import static org.jsola.hr.example.PositionInfoExample.M_SORT_NOT_NULL;
import static org.jsola.hr.example.PositionInfoExample.N_CODE;
import static org.jsola.hr.example.PositionInfoExample.N_COMPANY_ID;
import static org.jsola.hr.example.PositionInfoExample.N_DESC;
import static org.jsola.hr.example.PositionInfoExample.N_FORMAL_NUM;
import static org.jsola.hr.example.PositionInfoExample.N_NAME;
import static org.jsola.hr.example.PositionInfoExample.N_REMARK;
import static org.jsola.hr.example.PositionInfoExample.N_TYPE;

/**
 * @author zhr
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "新增【岗位信息】的参数")
@Data
public class PositionInfoAddDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = N_TYPE, example = E_TYPE)
    private Integer type;

    @ApiModelProperty(notes = N_NAME, example = E_NAME, required = true)
    @NotNull(message = M_NAME_NOT_NULL)
    @Length(max = 255, message = M_NAME_MAX)
    private String name;

    @ApiModelProperty(notes = N_CODE, example = E_CODE)
    @Length(max = 32, message = M_CODE_MAX)
    private String code;

    @ApiModelProperty(notes = N_REMARK, example = E_REMARK)
    @Length(max = 2000, message = M_REMARK_MAX)
    private String remark;

    @ApiModelProperty(notes = N_DESC, example = E_DESC)
    @Length(max = 2000, message = M_DESC_MAX)
    private String desc;

    @ApiModelProperty(notes = N_FORMAL_NUM, example = E_FORMAL_NUM)
    private Integer formalNum;

    @ApiModelProperty(notes = N_COMPANY_ID, example = E_COMPANY_ID, required = true)
    @NotNull(message = M_COMPANY_ID_NOT_NULL)
    @Length(max = 32, message = M_COMPANY_ID_MAX)
    private String companyId;

    @ApiModelProperty(notes = N_LEVEL, example = E_LEVEL, required = true)
    @NotNull(message = M_LEVEL_NOT_NULL)
    private Integer level;

    @ApiModelProperty(notes = N_SORT, example = E_SORT, required = true)
    @NotNull(message = M_SORT_NOT_NULL)
    private Integer sort;

    @ApiModelProperty(notes = N_PARENT_ID, example = E_PARENT_ID, required = true)
    @NotNull(message = M_PARENT_ID_NOT_NULL)
    @Length(max = 32, message = M_PARENT_ID_MAX)
    private String parentId;


}

